CashbackTable.tsx 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. "use client";
  2. import { CashbackTypes, Rule } from "@/api/cashback";
  3. import Table, { TableHeaderItem } from "@/components/Table";
  4. import { useTranslations } from "next-intl";
  5. import { JSX } from "react";
  6. import styles from "./components/style.module.scss";
  7. interface Props {
  8. cashbackInfo: CashbackTypes;
  9. }
  10. const Page = (props: Props) => {
  11. const { cashbackInfo } = props;
  12. const t = useTranslations("cashback");
  13. const columns: TableHeaderItem[] = [
  14. {
  15. title: <div className={"text-center text-primary-color"}>VIP</div>,
  16. dataIndex: "level",
  17. align: "center",
  18. width: "20%",
  19. render: (item: Rule) => <div className={"text-[0.13rem] font-bold"}>{item.level}</div>,
  20. },
  21. {
  22. title: <div className={"text-center text-primary-color"}>APOSTA</div>,
  23. dataIndex: "aposta",
  24. align: "center",
  25. width: "40%",
  26. render: (item: Rule) => (
  27. <div className={"text-[0.13rem] font-bold"}>{item.aposta} + BRL</div>
  28. ),
  29. },
  30. {
  31. title: (
  32. <div className={"text-center text-primary-color"}>CASHBACK</div>
  33. ) as JSX.Element,
  34. dataIndex: "cashback",
  35. align: "center",
  36. render: (item: Rule) => (
  37. <div className={"text-[0.13rem] font-bold"}>{item.cashback}%</div>
  38. ),
  39. },
  40. ];
  41. const loadMore = async () => {
  42. return Promise.resolve();
  43. };
  44. return (
  45. <>
  46. <Table
  47. columns={columns}
  48. dataSource={cashbackInfo.rules || []}
  49. loadMore={loadMore}
  50. hasMore={false}
  51. isLoadMore={false}
  52. isBackground={false}
  53. oddClassName={styles.odd}
  54. evenClassName={styles.even}
  55. tdClassName={styles.td}
  56. />
  57. {/*<Box*/}
  58. {/* className={clsx(*/}
  59. {/* "mt-[10px] rounded-[10px] shadow-[0_0_20px_#3796b3_inset]",*/}
  60. {/* styles.tableBox*/}
  61. {/* )}*/}
  62. {/*>*/}
  63. {/* <div className={"mb-[10px] text-[#00fffc]"}> {t("cashbackStatus")}</div>*/}
  64. {/* <Table*/}
  65. {/* columns={columns}*/}
  66. {/* dataSource={cashbackInfo.rules || []}*/}
  67. {/* loadMore={loadMore}*/}
  68. {/* hasMore={false}*/}
  69. {/* isLoadMore={false}*/}
  70. {/* isBackground={false}*/}
  71. {/* oddClassName={styles.odd}*/}
  72. {/* evenClassName={styles.even}*/}
  73. {/* tdClassName={styles.td}*/}
  74. {/* />*/}
  75. {/*</Box>*/}
  76. </>
  77. );
  78. };
  79. export default Page;